package kr.bae.score_pjt.DTO;

import kr.hkit.framework.util.MathUtil;

public class StdInfo {
	private int stdNum;
	private String stdName;
	private int korScore;
	private int engScore;
	private int mathScore;
	private int stdGrade;
	
	public StdInfo() {
		super();
	}

	public StdInfo(int stdNum, String stdName, int korScore, int engScore,
			int mathScore) {
		super();
		this.stdNum = stdNum;
		this.stdName = stdName;
		this.korScore = korScore;
		this.engScore = engScore;
		this.mathScore = mathScore;
	}
	
	public int getStdGrade() {
		return stdGrade;
	}

	public void setStdGrade(int stdGrade) {
		this.stdGrade = stdGrade;
	}

	public int getStdNum() {
		return stdNum;
	}

	public void setStdNum(int stdNum) {
		this.stdNum = stdNum;
	}

	public String getStdName() {
		return stdName;
	}

	public void setStdName(String stdName) {
		this.stdName = stdName;
	}

	public int getKorScore() {
		return korScore;
	}

	public void setKorScore(int korScore) {
		this.korScore = korScore;
	}

	public int getEngScore() {
		return engScore;
	}

	public void setEngScore(int engScore) {
		this.engScore = engScore;
	}

	public int getMathScore() {
		return mathScore;
	}

	public void setMathScore(int mathScore) {
		this.mathScore = mathScore;
	}
	
	public int calTotalScore() {
		return korScore + engScore + mathScore;
	}
	
	public int calAvgScore() {
		return (int) Math.round(MathUtil.getDecimalPosition(calTotalScore()/3.0, 1));
	}

	@Override
	public String toString() {
		return String
				.format("StdInfo [stdNum=%s, stdName=%s, korScore=%s, engScore=%s, mathScore=%s]",
						stdNum, stdName, korScore, engScore, mathScore);
	}
}
